import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { AppRouteGuard } from '@shared/common/auth/auth-route-app-guard';
import { RoadMonitoringComponent } from './road-monitoring.component';
import { RoadMonitoringManagementComponent } from './road-monitoring-management/road-monitoring-management.component';
import { LockLocateComponent } from './lock-locate/lock-locate.component';

const routes: Routes = [

  {
    path: '',
    canActivate: [AppRouteGuard],
    canActivateChild: [AppRouteGuard],
    component: RoadMonitoringComponent,
    data: { breadcrumb_no_url: 'online_supervise' },
    children: [
      {
        path: 'lockLocate',
        component: LockLocateComponent,
        data: { permission: 'A10_', activeMenu: 'lockLocate', tabBelong: 'road', breadcrumb: 'online_supervise' }
      },
      {
        path: 'roadMonitoring',
        component: RoadMonitoringManagementComponent,
        data: { permission: 'A10_', activeMenu: 'roadMonitoring', tabBelong: 'road', breadcrumb: 'track_view' }
      },
    ],
  },
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule]
})
export class RoadMonitoringRoutingModule { }
